#唐门优测
#道长最帅666
import os
from common.readCofig import Envison
import yaml

def get_yaml_filepath(Envison="",filepath=""):

    Envison1 = os.path.abspath(os.path.dirname(os.path.dirname(__file__)) + Envison)
    print("Envison1路径：",Envison1)
    filepath1 = os.path.abspath(os.path.dirname(os.path.dirname(__file__)) + r"/data" +'/' + filepath)
    if Envison:
        with open(Envison1,'r',encoding='utf-8') as f:
            return yaml.load(f,Loader=yaml.FullLoader)
    if filepath:
        with open(filepath1,'r',encoding='utf-8') as f:
            return yaml.load(f,Loader=yaml.FullLoader)


if __name__ == '__main__':
    print("daozhang:",get_yaml_filepath(Envison=Envison))
    print("daozhang2:",get_yaml_filepath(Envison=Envison,filepath='/member_controller/login.yaml'))